package com.entrogy.service;


import com.alibaba.fastjson.JSONObject;
import com.entrogy.bean.ClassScoreOverviewEntity;
import com.entrogy.bean.StaticCourseEntity;
import com.entrogy.bean.StudentCourseScoreEntity;
import com.entrogy.bean.StudentScoreEntity;

import java.util.List;
import java.util.Map;

/**
 * @ClassName StudentScoreService
 * @Description
 * @Author luoxingjiang
 * @Date 2019/6/4 0004 下午 4:31
 * @Version 1.0
 **/
public interface StudentScoreService {
    List<StudentScoreEntity> findStudentScoreList(Integer examId, Integer classType, Integer classId, String scoreTableName, Integer schoolCode, boolean exportScore, Integer studentId);

    List<StudentCourseScoreEntity> findStudentCourseScoreList(Map<String, Object> param);

    boolean updateScore(List<StudentCourseScoreEntity> studentCourseScoreEntities);

    List<ClassScoreOverviewEntity> findClassScoreOverviewList(Integer examId, Integer classId, Integer gradeId, String scoreTableName);

    List<JSONObject> findStudentScoreListForExport(Integer examId, List<StaticCourseEntity> staticCourses, String scoreTableName);

    List<StaticCourseEntity> findExamStaticCourse(Integer examId);

    Integer findCourseIdByStaticId(Integer staticCourseId, Integer examId, Integer studentId);

    boolean updateScoreByImport(String scoreTableName, StudentCourseScoreEntity studentCourseScoreEntity);

    /**
     * 分班级发送成绩
     * @param type
     * @param sendMethod
     * @param examId
     * @param scoreTableName
     * @param schoolCode
     * @param sendClassId
     * @return
     */
    Map<String, Object> sendWeApp(Integer type, Integer sendMethod, Integer examId, String scoreTableName, Integer schoolCode, Integer[] sendClassId);

    /**
     * 生成学生的课程班级排名
     * @param examId
     * @param scoreTableName
     * @param requireCourseClassRank
     * @param requireCourseGradeRank
     * @return
     */
    boolean generateStuCourseClassRank(Integer examId, String scoreTableName, Integer requireCourseClassRank, Integer requireCourseGradeRank);

    List<StudentScoreEntity> findStudentScoreListByRank(Integer examId, Integer classType, Integer classId, String scoreTableName, Integer schoolCode, boolean b, Integer studentId);

    /**
     * 生成总分班级排名
     * @param examId
     * @param scoreTableName
     * @param requireTotalScoreClassRank
     * @return
     */
    boolean generateStuTotalScoreClassRank(Integer examId, String scoreTableName, Integer requireTotalScoreClassRank);

    boolean generateStuTotalScoreGradeRank(Integer examId, String scoreTableName);

    /**
     * 生成单科班级中位分
     * @param examId
     * @param scoreTableName
     * @return
     */
    boolean generateCourseClassMiddleScore(Integer examId, String scoreTableName);

    /**
     * 生成单科年级中位分
     * @param examId
     * @param scoreTableName
     * @return
     */
    boolean generateCourseGradeMiddleScore(Integer examId, String scoreTableName);

    /**
     * 批量更新学生的课程分数
     * @param studentCourseScoreEntity
     * @param scoreTableName
     */
    boolean batchUpdateScore(List<StudentCourseScoreEntity> studentCourseScoreEntity, String scoreTableName);

    /**
     * 计算学生的理综/文综
     * @param examId
     * @param scoreTableName
     * @return
     */
    boolean generateScienceOrArts(Integer examId, String scoreTableName);

    /**
     * 计算学生的理综/文综排名
     * @param examId
     * @param scoreTableName
     * @param requireScienceOrArtsClassRank
     * @param requireScienceOrArtsGradeRank
     * @return
     */
    boolean generateScienceOrArtsRank(Integer examId, String scoreTableName, Integer requireScienceOrArtsClassRank, Integer requireScienceOrArtsGradeRank);
}
